package exception;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {

        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("./a/s.s");
            System.out.println("程序正常运行了");
        }catch (IOException io){
            System.out.println("程序出错了");
        }finally {
            try {
                if(fos!=null){
                    fos.close();
                }
            }catch (IOException io){
                System.out.println("finally出错了");
            }

        }
    }
}
